using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Chimera2.Classes
{
    public class Editor
    {
        private string userName;
        [XmlAttribute("Username")]
        public string UserName
        {
            get { return userName; }
            set { userName = value; }
        }

        private Guid guid;
        [XmlAttribute("GUID")]
        public Guid Guid
        {
            get { return guid; }
            set { guid = value; }
        }

        private bool active;
        [XmlAttribute("Active")]
        public bool Active
        {
            get { return active; }
            set { active = value; }
        }

        private bool canRemove;
        [XmlAttribute("CanRemove")]
        public bool CanRemove
        {
            get { return canRemove; }
            set { canRemove = value; }
        }

        private bool canEdit;
        [XmlAttribute("CanEdit")]
        public bool CanEdit
        {
            get { return canEdit; }
            set { canEdit = value; }
        }

        private bool canMove;
        [XmlAttribute("CanMove")]
        public bool CanMove
        {
            get { return canMove; }
            set { canMove = value; }
        }

        private List<Guid> accessTo = new List<Guid>(); // Bulletin
        public List<Guid> AccessTo
        {
            get { return accessTo; }
            set { accessTo = value; }
        }

        private bool globalAccess = true;
        [XmlAttribute("GlobalAccess")]
        public bool GlobalAccess
        {
            get { return globalAccess; }
            set { globalAccess = value; }
        }

        private List<Guid> accessFrom = new List<Guid>(); // Hub
        public List<Guid> AccessFrom
        {
            get { return accessFrom; }
            set { accessFrom = value; }
        }

        /// <summary>
        /// Shallow copies the Editor instance.
        /// </summary>
        public Editor Clone()
        {
            Editor e = (Editor)MemberwiseClone();

            e.Guid = System.Guid.NewGuid();
            return e;
        }
    }
}
